<?php 
require_once('./admin/View/video/inc_admin.php');
 ?>
<div id="content">

  <div class="inner" style="min-height:1200px;">
    <div class="row">
      <div class="col-lg-12">

        <?php 

$id=$_GET['id'];
$sql="select * from users where uid={$id}";
$result=mysql_query($sql) or die('查询失败！'.mysql_error());
$row=mysql_fetch_assoc($result);
//var_dump($row);
$uname=$row['uname'];
$gender=$row['gender'];
$birthdate=$row['birthdate'];
$hobby=$row['hobby'];
$degree=$row['degree'];
$intro=$row['intro'];
$pic='upload/'.$row['pic'];
//将查询结果显示在表单中 
?>

        <div class="container-fluid col-sm-offset-1 col-md-10">
          <form method="post" action="index.php?c=user&m=update" enctype="multipart/form-data">
            <table align="center" border="1" width=500 class="table table-bordered">
              <caption>
                <h2 align="center"> <font color="green">修改用户</font>
                </h2>
              </caption>
              <tr class="success">
                <td width="20%">id</td>
                <td width="80%">
                  <?php echo $id;?>
                  <input type="hidden" name="id" value=<?php echo $id?>></td>
              </tr>

              <tr>
                <td>姓名：</td>
                <td>
                  <input type="text" name="uname" size=30 value=<?php echo $uname;?>></td>
              </tr>
              <tr class="success">
                <td>性别：</td>
                <td>
                  <input type="radio" name="gender" value="0"<?php if(!$gender) echo 'checked';?>
                  >男
                  <input type="radio" name="gender" value="1"<?php if($gender) echo 'checked';?>>女</td>
              </tr>
              <tr>
                <td>生日：</td>
                <td>
                  <input type="date" name="birthdate" size=30 value=<?php echo $birthdate;?>></td>
              </tr>
              <tr class="success">
                <td>爱好：</td>
                <td>
                  <input type="checkbox" name="hobby[]" value="旅游"<?php if(strstr($hobby,'旅游')) echo 'checked';?>
                  >旅游
                  <input type="checkbox" name="hobby[]" value="登山"<?php if(strstr($hobby,'登山')) echo 'checked';?>
                  >登山
                  <input type="checkbox" name="hobby[]" value="健身"<?php if(strstr($hobby,'健身')) echo 'checked';?>
                  >健身
                  <input type="checkbox" name="hobby[]" value="上网"<?php if(strstr($hobby,'上网')) echo 'checked';?>
                  >上网
                  <input type="checkbox" name="hobby[]" value="游泳"<?php if(strstr($hobby,'游泳')) echo 'checked';?>>游泳</td>
              </tr>
              <tr>
                <td width=150>学历</td>
                <td>
                  <select name="degree">
                    <option value="0">---请选择---</option>
                    <option value="1"<?php if($degree=='1') echo 'selected'; ?>>高中</option>
                    <option value="2"<?php if($degree=='2') echo 'selected'; ?>>大学</option>
                    <option value="3"<?php if($degree=='3') echo 'selected'; ?>>研究生</option>
                    <option value="4"<?php if($degree=='4') echo 'selected'; ?>>博士生</option>
                  </select>
                </td>
              </tr>
              <tr class="success">
                <td width=150>自我介绍：</td>
                <td>
                  <textarea name="intro" cols="40" rows="5">
                    <?php echo $intro;?></textarea>
                </td>
              </tr>
              <tr>
                <td width=150>头像</td>
                <td>
                  <img src='<?php echo $pic;?>
                  ' width=120 height=130 class="img-rounded">
                  <input type="file" name="pic"></td>
              </tr>
              <tr class="success">
                <td width=150>操作</td>
                <td>
                  <input type="submit" value="更新" class="btn btn-info">
                  <input type="reset" value="重置" class="btn btn-info"></td>
              </tr>
            </table>
                        </form>
          </div>
        </div>
      </div>

    </div>

  </div>
  <!--END PAGE CONTENT -->

  <!--END MAIN WRAPPER -->

  <!-- FOOTER -->
  <div id="footer">
    <p>&copy;  binarytheme &nbsp;2014 &nbsp;</p>
  </div>
  <!--END FOOTER -->
  <!-- GLOBAL SCRIPTS -->
  <script src="assets/plugins/jquery-2.0.3.min.js"></script>
  <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="assets/plugins/modernizr-2.6.2-respond-1.1.0.min.js"></script>
  <!-- END GLOBAL SCRIPTS -->

  <!-- END BODY-->



  
</body>
</html>